Skip to content

feat: config option #5554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 11, 2021
Merged

feat: config option #5554

merged 7 commits into from
Aug 11, 2021

Conversation

farfromrefug
Copy link
Contributor

to set custom nativescript.config file name (relative, absolute, with or without .ts or .js)

read ignoredNativeDependencies from nativescript.config``nativescript.config

I added a test. What is weird to me is that some tests are failing.But i cant see how they could pass, like this one https://github.com/farfromrefug/nativescript-cli/blob/cdf912ecdbd01c34ab405df2e9e39268f982d71f/test/tools/node-modules/node-modules-dependencies-builder.ts#L536

to set custom `nativescript.config` file name (relative, absolute, with or without .ts or .js)

read `ignoredNativeDependencies` from `nativescript.config``nativescript.config`
@cla-bot cla-bot bot added the cla: yes label Jul 27, 2021
@rigor789
Copy link
Member

rigor789 commented Aug 8, 2021

Interesting side-effect of passing --config is that when the CLI spawns the webpack process for building it passes --config=path/to/webpack.config.js (or the one set in the config).

With webpack5, we require the CLI as a library and expose it through the Utils - but since the spawned webpack process now has --config=... in process.argv the CLI resolves the project config as webpack.config.js.

Workaround is to splice/delete the --config option from process.argv inside the @nativescript/webpack bin - which then makes everything work - except the case where you want to use a custom config file and read it through Utils.config.getValue()...

@farfromrefug
Copy link
Contributor Author

@rigor789 would nt it be simpler to rename this option ? Like nconfig maybe .

rigor789 added a commit to NativeScript/NativeScript that referenced this pull request Aug 9, 2021
@rigor789
Copy link
Member

rigor789 commented Aug 9, 2021

Did some tweaking with both the CLI and the webpack bin to handle this case correctly.

A small issue I need to fix is the config lookup - right now it will set all 3 paths to the resolved config (TSConfigPath, JSConfigPath, NSConfigPath). WIP

@rigor789 rigor789 added this to the 8.1 milestone Aug 11, 2021
@rigor789
Copy link
Member

TODO: Add ignoredNativeDependencies: string[] to the NativeScript Config interface: https://github.com/NativeScript/NativeScript/blob/master/packages/core/config/config.interface.ts

@rigor789 rigor789 merged commit 9f844ea into NativeScript:master Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants